﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Reflection;

namespace CrazyWorship1.Class_Files.Exceptions
{
  public static class SendException
    {
       public static void Send(Exception e)
       {
           ExceptionHandler.ExceptionHandlerSoapClient c = new ExceptionHandler.ExceptionHandlerSoapClient();

           string message = e.Message;
           string source = e.Source;
           string stack = e.StackTrace;
           string target = e.TargetSite.ToString();
           string curdir = Environment.CurrentDirectory;
           string machine = Environment.MachineName;
           string osversion = Environment.OSVersion.ToString();
           string proccount = Environment.ProcessorCount.ToString(CultureInfo.InvariantCulture);
           string userdomainname = Environment.UserDomainName;
           string userinteractive = Environment.UserInteractive.ToString();
           string username = Environment.UserName;
           string netversion = Environment.Version.ToString();
           string workingset = Environment.WorkingSet.ToString(CultureInfo.InvariantCulture);
           string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
           c.HandleException(version, message, source, stack, target, curdir, machine, osversion, proccount, userdomainname, userinteractive, username, netversion, workingset);
           //TODO ASYNC
       }
    }
}
